Telegram Group & Telegram Channel
Дополнение про property

Важно отметить, что property – это класс, реализованный через протокол дескриптора. Его методы setter, getter, deleter и их использование в качестве декораторов – синтаксический сахар.

Конструктор property принимает на вход аргументы fget, fset, fdel, которые должны быть функциями. Они отвечают за получение, установку нового значения и удаление атрибута соответственно.

Простыми словами, в примере property прикрепляет функции get_age и set_age к атрибуту age. Также можно было реализовать условный delete_age, который отвечал бы за удаление атрибута.

Кстати, можете посмотреть простейшую реализацию такого свойства в официальной документации.

#классы #property



tg-me.com/python_academy/879
Create:
Last Update:

Дополнение про property

Важно отметить, что property – это класс, реализованный через протокол дескриптора. Его методы setter, getter, deleter и их использование в качестве декораторов – синтаксический сахар.

Конструктор property принимает на вход аргументы fget, fset, fdel, которые должны быть функциями. Они отвечают за получение, установку нового значения и удаление атрибута соответственно.

Простыми словами, в примере property прикрепляет функции get_age и set_age к атрибуту age. Также можно было реализовать условный delete_age, который отвечал бы за удаление атрибута.

Кстати, можете посмотреть простейшую реализацию такого свойства в официальной документации.

#классы #property

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/879

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

Look for Channels Online

You guessed it – the internet is your friend. A good place to start looking for Telegram channels is Reddit. This is one of the biggest sites on the internet, with millions of communities, including those from Telegram.Then, you can search one of the many dedicated websites for Telegram channel searching. One of them is telegram-group.com. This website has many categories and a really simple user interface. Another great site is telegram channels.me. It has even more channels than the previous one, and an even better user experience.These are just some of the many available websites. You can look them up online if you’re not satisfied with these two. All of these sites list only public channels. If you want to join a private channel, you’ll have to ask one of its members to invite you.

A Telegram spokesman declined to comment on the bond issue or the amount of the debt the company has due. The spokesman said Telegram’s equipment and bandwidth costs are growing because it has consistently posted more than 40% year-to-year growth in users.

Python Academy from tr


Telegram Python Academy
FROM USA